package com.powernode;

import cn.hutool.core.lang.Snowflake;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @version 1.0
 * @Date 2024/8/19 16:58
 * @Author 付~~~
 */

/**
 * 订单业务模块启动类
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients     // 开启远程客户端
public class OrderServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderServiceApplication.class,args);
    }

    /**
     * 雪花算法生成一个全局唯一的订单编号
     * @return
     */
    @Bean
    public Snowflake snowflake(){
        return new Snowflake(0L,0L);
    }
}